package com.asiainfo.ncrm.fragment;

import com.asiainfo.ncrm.R;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebSettings.LayoutAlgorithm;
import android.webkit.WebView;
import android.webkit.WebViewClient;

public class FragmentPage1 extends Fragment{
     private WebView webview;
	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		return  inflater.inflate(R.layout.fragment_1, container, false); 
	}
	 
   
 

@Override
public void onActivityCreated(Bundle savedInstanceState) {
	// TODO Auto-generated method stub
	   
	 setView(); 
	 setListener();
	super.onActivityCreated(savedInstanceState);
}




private void setListener() {
	// TODO Auto-generated method stub
	webview.loadUrl("http://www.youku.com");
	 
	webview.setWebViewClient(new WebViewClient(){       
        public boolean shouldOverrideUrlLoading(WebView   view, String url) {       
            view.loadUrl(url);    
            return true;       
        }       
}); 

}




private void setView() {
	// TODO Auto-generated method stub
	 webview=(WebView)getView().findViewById(R.id.webView1);
	 
}
   
}
